<?php
namespace App\Common\Lib\Fun;

use App\Common as com;

class Page {
	/**
	 * 获取“提示”html
	 * @param str $title 提示标题
	 * @param str $content 提示内容
	 * @param array $param 参数数组 <br />
	 * ················· [可空](str)	$param['html_title']	说明：网页标题	<br />
	 * ················· [可空](str)	$param['detail']	说明：提示详细	<br />
	 * ················· [可空](str)	$param['foothtml']	说明：页尾数据	<br />
	 * ················· [可空/多选_A/必须](unknown_type)	$param['AAAAA']	说明：AAAAA	<br />
	 * @return string 返回提示的html代码
	 */
	public static function showTip( string $title, string $content = '', array $param = [] ){
		// ...
		$param['html_title'] = $param['html_title'] ?? '';
		$param['detail'] = $param['detail'] ?? '';
		//
		$show_html = '';
		//
		$show_html .= '<html>';
		$show_html .= '<head>';
		$show_html .= '<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />';
		$show_html .= "<title>{$param['html_title']}</title>";
		$show_html .= '	</head><body>';
		
		$show_html .= '<style type="text/css">
				*{ padding: 0; margin: 0; }
				.think_default_text{ padding: 4px 48px;}
				a{color:#2E5CD5;cursor: pointer;text-decoration: none}
				a:hover{text-decoration:underline; }
				body{ background: #fff; font-family: "Century Gothic","Microsoft yahei"; color: #333;font-size:18px}
				h1{ font-size: 25px; font-weight: normal; margin-bottom: 12px; }
				p{ line-height: 1.6em; font-size: 15px }
				</style>';
		$show_html .= '<div style="padding: 24px 48px;">';
		$show_html .= "<h1>{$title}</h1><p> {$content}<br/><span style='font-size:15px'>{$param['detail']}</span></p>";
		
		$show_html .= "</body>";
		// 添加页尾数据
		if( isset( $param['foothtml'] ) ){
			$show_html .= $param['foothtml'];
		}
		//
		return $show_html;
	}
	
}
